<!-- 模态框（Modal） -->
<div class="modal fade" id="add" tabindex="-1" role="dialog" 
   aria-labelledby="addModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="addModalLabel">
               添加节点信息
            </h4>
         </div>
         <div class="modal-body">
            <form role="form" action="__URL__/insert" method="post" id="nodeAddForm">
            	<div class="box-body">
            		<input type="hidden" name="user_id" value="<?php echo $_SESSION[C('USER_AUTH_KEY')] ?>"/> 
            		<input type="hidden" name="level" value="{$level}">
					<input type="hidden" name="pid" value="{$pid}">

					<div class="form-group">
						<label for="name">模块名：</label>
						<input type="text" class="form-control"  name="name" >

					</div>
					<div class="form-group">
					  	<label>显示名：</label>
						<input type="text" class="form-control"  name="title" >
					</div>
					<div class="form-group">
						<label>分 组：</label>
						<SELECT name="group_id" class="form-control">
							<option value="">未分组</option>
						</SELECT>
					</div>
					<div class="form-group">
						<label>顺序：</label>
						<input   name="sort" type="text" class="form-control" value="0" size="5" />
					</div>
					<div class="form-group">
						<label>状态：</label>
						<SELECT name="status">
							<option value="1">启用</option>
							<option value="0">禁用</option>
						</SELECT>
					</div>
					<div class="form-group">
						<label>描 述：</label>
						<TEXTAREA name="remark"  rows="3" cols="57"></textarea>
					</div>
				</div><!-- /.box-body -->

				<div class="box-footer">
					<button type="submit" class="btn btn-primary">Submit</button>
				</div>
            </form>
         </div>
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>


<script type="text/javascript">
    function ajaxGetNodeData() {
        $.ajax('__URL__/ajax_get_add_data',{method:'post',type:'json'})
        .done(function(data){
             data = eval('('+data+')');
             var lists = data.list;
            for (var i = 0;i < lists.length;i++) {
                $('[name="group_id"]').append('<option value="'+lists[i].id+'">'+lists[i].title+'</option>')
            }
            $('[name="level"]').val(data.level);
            $('[name="pid"]').val(data.pid);
        });
    }
</script>
